<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        Schema::defaultStringLength(191);
        if(app()->environment() != "production"){
            // DB::listen(function($query) {
            //     $tmp = str_replace('?', '"'.'%s'.'"', $query->sql);
            //     $tmp = vsprintf($tmp, $query->bindings);
            //     $tmp = str_replace("\\","",$tmp);
            //     Log::info(' execution time: '.$query->time.'ms; '.$tmp);
            // });
        }
    }
}
